﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace Event_SG_EWDT
{
    public class NotificationControl
    {
        public static string CreateNotification(int sender, int reciever, string notification, DateTime time)
        {
            Notification n = new Notification();
            n.NotificationContent = notification;
            n.sender = sender.ToString();
            n.receiver = reciever.ToString();
            n.time = time;
            n.Notice_id = DBMANAGER.CreateNotification(n);

            return n.Notice_id;

        }

        public static List<Notification> RetrieveNotification(string my_membership_no )
        {
           return DBMANAGER.RetrieveMyNotification(my_membership_no);
        }

        public static int NoOfUnreadMessage(string member_no)
        {
            return DBQUERIES.NoOfUnreadNotification(member_no).Count;
        }
       
    }
}